package test;

import jxl.Cell;
import jxl.write.Label;
import jxl.write.WritableSheet;

public class FillCell {
	
	public void fillWith_n(WritableSheet sheet, int n, int i, String content1, String result1){
		
		try{
			
			Label label = new Label(1, n, content1); 
			sheet.addCell(label);
	    
			Cell cell = sheet.getCell(0, n);
			String result = cell.getContents().substring(13, 20);
	    
			int flags = Integer.parseInt(result1) - Integer.parseInt(result) + 1;
			jxl.write.Number numb = new jxl.write.Number(2, n, flags);
			sheet.addCell(numb);
	    
			for(int r = n + 1; r <= i - 1; r++){
				Label label1 = new Label(0, r, "1"); 
				sheet.addCell(label1);
			}
			
		} catch (Exception e) {
			System.out.println(e);
		}                     		
	}
	

	
	public void fillWith_1(WritableSheet sheet, int i){
		
		try{
			
			Cell cell = sheet.getCell(0, i-1);
            String content = cell.getContents();
            
            Label label = new Label(1, i-1, content); 
            sheet.addCell(label);
            
    		jxl.write.Number numb = new jxl.write.Number(2, i-1, 1);
            sheet.addCell(numb);
			
		} catch (Exception e) {
			System.out.println(e);
		}                     		
	}
	
	
}
